﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace YArchitech.Temp
{
	internal class FlowToSpecifications : SortedSet<FlowToSpecification>
	{
		public FlowToSpecification GetSpecification(double flow)
		{
			IEnumerable<FlowToSpecification> enumerable = from sp in this
			where FlowToSpecification.FlowEqual(sp.Flow, flow)
			select sp;
			if (enumerable == null || enumerable.Count<FlowToSpecification>() == 0)
			{
				return null;
			}
			return enumerable.First<FlowToSpecification>();
		}
	}
}
